<?php 
    $id = $this->_data['account_id'];
     $avatar = $this->_data['avatar'];
    $selected_race_setting = array(
    'table_name' => 'doggy_race',
    'key_field' => 'id',
    'value_field' => 'race_name',
    'init_data' => array('key'=>'','name'=>'(Select race)')
    );
    $selected_region_setting = array(
    'table_name' => 'doggy_region',
    'key_field' => 'id',
    'value_field' => 'region',
    'init_data' => array('key' => '','name'=>'(Select region)')
    //'where' =>array('parent >' => 0)
    );
?>
<!--END WRAPPER-BANNER-->
<div id="wrapper-contenu">
<div id="col1">
    <div id="login" align="center">
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrtop_login.png" class="bgrtop" border="0"/>
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrbottom_login.png" class="bgrbottom" border="0"/>
        <div class="contenu">
            <table id="tbprofil">
                <tr>
                    <td>
                        <?php
        $image_ava = './doggy_avatar/images/' . $avatar;
        if(file_exists($image_ava) && $avatar != null){
            $image_ava = base_url() . 'doggy_avatar/images/' . $avatar;
        } else{
            $image_ava = root_url('doggy-flirt') .'./assets/noimage.gif';
    }?>
         <img src="<?php echo $image_ava;?>" width="80" border="0">
                    </td>
                    <td><a style="font-size:14px;" href="<?php echo site_url('home/edit_profile') . '/' . $id ?>" ><?php echo $this->session->userdata('doggy_display_name') ?></a>
                    <p <?php if($total_unread>0 OR $total_unread_reply) echo 'style="text-decoration: blink;font-weight: bold;"';?>><a href="<?php echo site_url('message/list_all_messages') ?>" ><font color="red">Message (<?php echo ($total_unread+$total_unread_reply); ?>)</font></a></p>
                    </td>
                </tr>
                 <tr>

                    <td><a href="<?php echo site_url('home/edit_profile') . '/' . $id; ?>">Modifier profil  |</a></td>
                    <td><a href="<?php echo site_url('home/change_pass') . '/' . $id ; ?>">Modifier mot de passe</a></td>
                </tr>
            </table>
        </div>
        <!--END CONTENU-->
    </div>
    <ul class="sidebar">
        <li><a href="<?php echo site_url('home/show_wall_message');?>"><span class="icon_sidebar"><img border="0" align="center" src="<?php echo base_url().'assets/css/'?>images/icon_home.png"/></span> Accueil</a></li>
        <li><a href="<?php echo site_url('home/wall_friend'.'/'.$this->_data['account_id']);?>"><span class="icon_sidebar"><img border="0" align="center" src="<?php echo base_url().'assets/css/'?>images/icon_mur.png"/></span> Mon mur</a></li>
        <li><a href="<?php echo site_url('image/my_galary/');?>"><span class="icon_sidebar"><img border="0" align="center" src="<?php echo base_url().'assets/css/'?>images/icon_photo.png"/></span> Mon galerie</a></li>
    </ul>
    <div id="horoscope">
        <?php if(count($request_friends)>0):?>
            <div class="titre_home">Demande d'ajout à la liste des amis</div>
            <table width="100%">
                <?php foreach ($request_friends as $request): ?>
                <?php 
                    $image_ava = './doggy_avatar/images/' . $request['avatar'];
                    if(file_exists($image_ava) && $request['avatar'] != null){
                        $image_ava = base_url() . 'doggy_avatar/images/' . $request['avatar'];
                    } else{
                        $image_ava = root_url('doggy-flirt') .'./assets/noimage.gif';
                }?>
                    <tr>
                        <td width="30%"><div align="center" style="width: 50px;height: 50px;background: transparent"><img src="<?php echo $image_ava;?>" align="middle" border="0" style="max-width: 50px;max-height: 50px" alt=""/></div></td>
                        <td width="50%"><a class="account_link" href="<?php echo site_url('home/compte').'/'.$request['from_account']?>"><span class="noun"><?php echo $request['display_name']; ?></span></a></td>
                        <td align="center"><a href="<?php echo site_url('friend/accept/' . $request['from_account']) ?>" style="color: #5d94c5;"><span class="write_message_to_friend"><img border="0" align="center" title ="Confirmer la demande" src="<?php echo base_url().'assets/css/'?>images/check_add_friend.png"/></span></a></td>
                    </tr>
                    <?php endforeach; ?>
                       <tr>
                <td colspan="3"><a href="<?php echo site_url('friend/list_all_request')?>"  style="float: right; padding-top: 3px; color: #5d94c5;">Voir plus »</a></td>
                </tr>
            </table>
            <?php endif;?>
    </div>
    <div>
        <?php if(count($friends)>0){?>
            <div class="titre_home">Liste des amis</div>
            <table width="100%">
                <?php foreach ($friends as $friend): ?>
                <?php
                    $image_ava = './doggy_avatar/images/' . $friend['avatar'];
                    if(file_exists($image_ava) && $friend['avatar'] != null){
                        $image_ava = base_url() . 'doggy_avatar/images/' . $friend['avatar'];
                    } else{
                        $image_ava = root_url('doggy-flirt') . './assets/noimage.gif';
                }?>
                    <tr>
                        <td width="30%"><div align="center" style="width: 50px;height: 50px;background: transparent"><a class="account_link" href="<?php echo site_url('home/compte').'/'.$friend['friend_id']?>"><img src="<?php echo $image_ava; ?>" align="middle" border="0" style="max-width: 50px;max-height: 50px" alt=""/></a></div></td>
                        <td width="50%"><a class="account_link" href="<?php echo site_url('home/compte').'/'.$friend['friend_id']?>"><span class="noun"><?php echo $friend['display_name']; ?></span></a></td>
                        <td><span class="write_message_to_friend"><a href="<?php echo site_url('message/send/' . $friend['friend_id']); ?>"><img border="0" align="center" title="Envoyer un message" src="<?php echo base_url().'assets/css/'?>images/mess_to_friend.png"/></a></span></td>
                    </tr>
                    <?php endforeach; ?>
                    <tr>
                <td colspan="3"><a href="<?php echo site_url('friend/list_friends')?>" style="float: right; padding-top: 3px; color: #5d94c5;">Voir plus »</a></td>
                </tr>
            </table>
            <?php }?>
    </div>
    <div>
        <?php if(count($not_friends)>0):?>
        <div class="titre_home">Suggestions !</div>
        <table width="100%">
            <?php foreach ($not_friends as $friend1): ?>
                <?php 
                    $image_ava = './doggy_avatar/images/' . $friend1['avatar'];
                    if(file_exists($image_ava) && $friend1['avatar'] != null){
                        $image_ava = base_url() . 'doggy_avatar/images/' . $friend1['avatar'];
                    } else{
                        $image_ava = root_url('doggy-flirt') . 'assets/noimage.gif';
                }?>
                <tr>
                    <td width="30%"><div align="center" style="width: 50px;height: 50px;background: transparent"><a class="account_link" href="<?php echo site_url('home/compte').'/'.$friend1['id']?>"><img src="<?php echo $image_ava;?>" align="middle" border="0" style="max-width: 50px;max-height: 50px" alt=""/></a></div></td>
                    <td width="50%"><a class="account_link" href="<?php echo site_url('home/compte').'/'.$friend1['id']?>"><span class="noun"><?php echo $friend1['display_name']; ?></span></a></td>
                    <td><a href="<?php echo site_url('friend/send_friend_request/' . $friend1['id']); ?>"><span class="write_message_to_friend"><img border="0" align="center" title="Ajouter à mes amis" src="<?php echo base_url().'assets/css/'?>images/add_friend.png"/></span></a></td>
                </tr>
                <?php endforeach; ?>
                <tr>
                <td colspan="3"><a href="<?php echo site_url('friend/random_accounts')?>" style="float: right; padding-top: 3px; color: #5d94c5;">Voir plus »</a></td>
                </tr>
        </table>
        <?php endif;?>
    </div>
    <!--END horoscope-->
    <!--END BOX promenade-->
    <div id="horoscope">
        <div class="titre_home"> HOROSCOPE</div>
        <table width="100%">
            <?php foreach ($list_horoscope as $hc): ?>
                <?php
                    $image = './../assets/avatar/images/' . $hc['avatar'];
                    if (file_exists($image) && $hc['avatar'] != null) {
                        $image = root_url('doggy-flirt') . 'assets/avatar/images/' . $hc['avatar'];
                    } else {
                        $image = root_url('doggy-flirt') . './assets/noimage.gif';
                } ?>
                <tr>
                    <td rowspan="2" valign="top"><a href="<?php echo site_url('horoscope/detail_horoscope' . '/' . $hc['id']) ?>" class="suite"><img border="0" src="<?php echo $image; ?>" width="80"/></a></td>
                    <td style="padding-left: 10px;" text-align="justify"><?php echo get_short_description($hc['description'], 10); ?></td>
                </tr>
                <tr>
                    <td align="right"><a href="<?php echo site_url('horoscope/detail_horoscope' . '/' . $hc['id']) ?>" class="suite">Lire la suite »</a><td>
                </tr>
                <?php endforeach; ?>
            <tr>
                <td colspan="2"><a href="<?php echo site_url('horoscope/list_horoscope')?>"  class="suite" style="float: left">Voir tous les horoscopes</a></td>
            </tr>
        </table>
    </div>
    <div id="box_promenade" class="box">
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrtop_2.png" class="bgrtop"/>
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrbottom_2.png" class="bgrbottom"/>
        <div class="contenu_box">
            <div class="titre_box" >PARC PRES DE CHEZ VOUS</div>
            <div class="detail_box" >
                <table width="100%">
                    <?php foreach ($list_parkway as $park ): ?>
                        <?php
                            $image = './assets/parkway/images/' . $park['image'];
                            if (file_exists($image)&& $park['image'] != null) {
                                $image = base_url().'assets/parkway/images/' . $park['image'];
                            } else {
                                $image = root_url('doggy-flirt') . './assets/noimage.gif';
                        } ?>
                        <tr>
                            <td width="40%" valign="top"><a href="<?php echo site_url('parkway/detail_parkway' . '/' . $park['id']) ?>" style="float:left;"><img border="0" src="<?php echo $image; ?>" width="80"/></a></td>
                            <td style="padding-left: 10px;" text-align="justify"><a href="<?php echo site_url('parkway/detail_parkway' . '/' . $park['id']) ?>"><?php echo $park['name']; ?></a><td>
                        </tr>
                        <?php endforeach; ?>
                    <tr>
                        <td colspan="2"><a href="<?php echo site_url('parkway/list_parkway') ?>" class="suite" style="float: left;color:#5d94c5;">Voir tous les parcs</a></td>
                    </tr>
                </table>
            </div>
        </div>
        <!--END CONTENU-->
    </div>
    <div id="box_membre" class="box">
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrtop_3.png" class="bgrtop"/>
        <img src="<?php echo base_url() . 'assets/css/' ?>images/bgrbottom_3.png" class="bgrbottom"/>
        <div class="contenu_box">
            <div class="titre_box" >MEMBRES</div>
            <div class="detail_box" >
                <table width="100%">
                    <?php for ($index = 0; $index < count($list_member); $index++):?>
                        <?php
                            $image = './doggy_avatar/images/' . $list_member[$index]['avatar'];
                            if (file_exists($image) && $list_member[$index]['avatar'] != null) {
                                $image = base_url() . 'doggy_avatar/images/'. $list_member[$index]['avatar'];
                                
                            } else {
                                $image = root_url('doggy-flirt') . './assets/noimage.gif';
                        } ?>
                        <?php if(($index)%2 == 0):?>
                            <tr>
                                <?php endif;?>
                            <td width="40%" valign="top">
                                <div align="center" style="width: 84px;height: 84px;background: transparent"><a href="<?php echo site_url('home/compte').'/'.$list_member[$index]['id']?>"><img align="middle" border="0" src="<?php echo $image; ?>" style="max-width: 80px;max-height: 80px" alt=""/></a></div>
                            <br/>
                            <a href="<?php echo site_url('home/compte').'/'.$list_member[$index]['id']?>"><span class="noun"><?php echo $list_member[$index]['display_name']?></span></a>
                            </td>
                            <?php if($index%2==1):?>
                            </tr>
                            <?php endif;?>
                        <?php endfor;?>
                    <tr>
                        <td colspan="2"><a href="<?php echo site_url('home/nouveaux_membres')?>"  class="suite" style="float: left">Voir tous les membres</a></td>
                    </tr>
                </table>
            </div>
        </div>
        <!--END CONTENU-->
    </div>
    <!--END BOX membre-->
            </div>
            <!--END col1-->
            <div id="col2">